package com.ygqh.baby.service;

import com.ygqh.baby.ao.*;
import com.ygqh.baby.model.BargainProductListModel;
import com.ygqh.baby.model.EditBargainReq;
import com.ygqh.baby.model.ProductBargainData;
import com.ygqh.baby.po.YgBargain;
import com.ygqh.baby.po.YgProduct;

import java.util.Date;
import java.util.List;

public interface YgBargainService {

    List<YgBargain> find();

    int findCount();

    YgBargain findById(Long id);

    int deleteSoft(Long[] ids);

    int deleteSoft(Long id);

    int save(YgBargain ygBargain);

    int update(YgBargain ygBargain);

    int saveOrUpdate(YgBargain ygBargain);

    ResultSet<YgBargain> search(QueryInfo queryInfo, String q, JobStatus jobStatus, Date startDate, Date endDate);

    List<YgProduct> findProductForBargain(QueryInfo queryInfo, String productName, Long groupId, Long bargainId);

    /**
     * 当前商品是否参与砍价活动（进行中） </br> 此处进行中为：倒计时未完成，完成砍价尚未生成订单
     *
     * @param productId
     * @param bargainId (可空)
     * @return Boolean 返回类型
     * @throws
     * @Title: existBargain
     * @author （guohao）
     * @date 2017年8月18日 上午10:46:07
     * @version V1.0
     */
    Boolean existBargain(Long productId, Long bargainId);

    /**
     * 前台砍价列表（未结束活动）
     * @param queryInfo
     * @param bargainId
     * @param salesPlatform
     * @return
     */
    List<BargainProductListModel> findBargainProductList(QueryInfo queryInfo, Long bargainId, SalesPlatform salesPlatform);

    List<YgBargain> findBargainList(PromotionStatus promotionStatus, SalesPlatform salesPlatform);

    int editBargain(EditBargainReq editBargainReq);

    ProductBargainData findProductBargainData(Long productId, Long bargainId, String platformNo);

    ProductBargainData findProductBargainData(Long userBargainId);
    YgBargain findBargainByProductId(Long productId, SalesPlatform salesPlatform);



}
